//
//  ViewController.m
//  11104
//
//  Created by student on 16/2/29.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    for (int i=0; i<10; i++)
    {
        UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(80*i, 15, 80, 30)];
        [btn setTitle:[NSString stringWithFormat:@"新闻%i",i] forState:UIControlStateNormal];
        [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
        [btn setTitleColor:[UIColor greenColor] forState:UIControlStateHighlighted];
        [self.scrolView addSubview:btn];
    }
    self.scrolView.backgroundColor = [UIColor blackColor];
    self.scrolView.contentSize = CGSizeMake(80*10, 0);
    self.scrolView.pagingEnabled = YES;
    self.scrolView.showsHorizontalScrollIndicator = NO;
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
